//暴漏一个句柄
import React, { forwardRef, useImperativeHandle, useState } from 'react';
import { Modal } from 'antd';

const index = (props, ref) => {
  const [isShow, setIshow] = useState(false);

  useImperativeHandle(ref, () => {
    return {
      open: () => {
        setIshow(true);
      },
      close: () => {
        setIshow(false);
      },
    };
  });

  return (
    <>
      <Modal title={'默认标题'} open={isShow} {...props}></Modal>
    </>
  );
};

export default forwardRef(index);
